home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Informant Complete 1995 - 2000
/
Delphi Informant Complete 1995 to 2000.iso
/
Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar
/
1998
/
Jul
/
di9807rl
/
aniform.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-02-24
|
2KB
|
68 lines
unit AniForm;
{ Demostration of palettes and animation in a Delphi component.
Copyright ⌐ 1998 Tempest Software, Inc.
This program demonstrate some simple uses for a display palette
in Windows, including palette animation. Palette animation works
only with video adapters that use a system palette, so if the display
does not use a palette, the animation start button is disabled.
Most of the interesting stuff is in the Moving.pas file, which
implements the TMovingGradient component. This is the main form,
which creates the TMovingGradient component.
}
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ExtCtrls, Moving, Gradient;
type
TDemoForm = class(TForm)
Panel1: TPanel;
StartButton: TButton;
StopButton: TButton;
Panel2: TPanel;
Gradient: TMovingGradient;
procedure StartButtonClick(Sender: TObject);
procedure StopButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DemoForm: TDemoForm;
implementation
{$R *.DFM}
procedure TDemoForm.StartButtonClick(Sender: TObject);
begin
StartButton.Enabled := False;
StopButton.Enabled := True;
Gradient.Enabled := True;
end;
procedure TDemoForm.StopButtonClick(Sender: TObject);
begin
Gradient.Enabled := False;
StopButton.Enabled := False;
StartButton.Enabled := True;
end;
procedure TDemoForm.FormCreate(Sender: TObject);
begin
{ Check the display. If it does not use a palette, then do not
try to animate the palette. }
if (Rc_Palette and GetDeviceCaps(Canvas.Handle, RasterCaps)) = 0 then
StartButton.Enabled := False;
end;
end.